//
//@File    :	8.3_sceref.cpp
//@Time    :	2021/08/14 20:08:15
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	defining and using a reference
//

#include <iostream>

using namespace std;

int main()
{
    int rats = 101;
    int &rodents = rats;

    cout << "rats = " << rats;
    cout << ", rodents = " << rodents << endl;

    cout << "rats adress = " << &rats;
    cout << ",rodents daress = " << &rodents << endl;

    int bunnies = 50;
    rodents = bunnies;
    cout << "bunnies = " << bunnies;
    cout << "rats = " << rats;
    cout << ",rodents = " << rodents << endl;

    cout << "bunnies adress = " << &bunnies;
    cout << ", rodents adress = " << &rodents << endl;

    system("pause");
    return 0;
}

//int &redents = rats;
//实际是下面的代码的伪装表示
//int * const pr = &rats